home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / GRAFLIB.ASM < prev    next >
Assembly Source File  |  1987-12-29  |  1KB  |  94 lines

  1. ;
  2. ; grafix --- graflib.asm
  3. ;
  4. ; miscellaneous assembly routines
  5. ;
  6. ; Written 4/87 by Scott Snyder (ssnyder@romeo.caltech.edu or @citromeo.bitnet)
  7. ;
  8. ; Modified 5/29/87 by sss to allow for different memory models
  9. ;
  10.  
  11.     title    graflib
  12.  
  13. include    macros.ah
  14.  
  15. buflen equ 32768
  16.  
  17. sseg
  18. endss
  19.  
  20. dseg
  21. endds
  22.  
  23. buf    segment public 'BUF'
  24.     db buflen dup(?)
  25. buf    ends
  26.  
  27. cseg    _graflib
  28.  
  29. pBegin    g_bufseg
  30.  
  31.     mov    ax, buf
  32.     ret
  33.  
  34. pEnd    g_bufseg
  35.  
  36. pBegin    g_fmemcpy 
  37.  
  38.     push    bp
  39.     mov    bp,sp
  40.     push    di
  41.     push    si
  42.     push    ds
  43.  
  44.     cld 
  45.     les    di,[bp+argbase]
  46.     lds    si,[bp+argbase+4]
  47.     mov    cx,[bp+argbase+8]
  48.     shr    cx, 1
  49.     jnc    c1
  50.     movsb
  51. c1:    rep    movsw
  52.   
  53.     pop    ds
  54.     pop    si
  55.     pop    di
  56.     mov    sp,bp
  57.     pop    bp
  58.     ret
  59.  
  60. pEnd    g_fmemcpy
  61.  
  62. pBegin    g_fmemset
  63.  
  64.     push    bp
  65.     mov    bp,sp
  66.     push    di
  67.     push    si
  68.  
  69.     cld 
  70.     les    di,[bp+argbase]
  71.     mov    al,[bp+argbase+4]
  72.     mov    ah,al
  73.     mov    cx,[bp+argbase+6]
  74.     shr    cx,1
  75.     jnc    s1
  76.     stosb
  77. s1:    rep    stosw
  78.   
  79.     pop    si
  80.     pop    di
  81.     mov    sp,bp
  82.     pop    bp
  83.     ret
  84.  
  85. pEnd    g_fmemset
  86.  
  87.     df_    g_fmemcpy
  88.     df_    g_fmemset
  89.     df_    g_bufseg
  90.  
  91. endcs    _graflib 
  92.  
  93.     end
  94.